\(\int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx\) [343]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 32, antiderivative size = 62 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {(B+2 C) \tan (c+d x)}{3 a^2 d (1+\sec (c+d x))}+\frac {(B-C) \tan (c+d x)}{3 d (a+a \sec (c+d x))^2} \]

[Out]

1/3*(B+2*C)*tan(d*x+c)/a^2/d/(1+sec(d*x+c))+1/3*(B-C)*tan(d*x+c)/d/(a+a*sec(d*x+c))^2

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.094, Rules used = {4137, 12, 3879} \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {(B+2 C) \tan (c+d x)}{3 a^2 d (\sec (c+d x)+1)}+\frac {(B-C) \tan (c+d x)}{3 d (a \sec (c+d x)+a)^2} \]

[In]

Int[(B*Sec[c + d*x] + C*Sec[c + d*x]^2)/(a + a*Sec[c + d*x])^2,x]

[Out]

((B + 2*C)*Tan[c + d*x])/(3*a^2*d*(1 + Sec[c + d*x])) + ((B - C)*Tan[c + d*x])/(3*d*(a + a*Sec[c + d*x])^2)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 3879

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[-Cot[e + f*x]/(f*(b + a*
Csc[e + f*x])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rule 4137

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_.) +
 (a_))^(m_), x_Symbol] :> Simp[(-(a*A - b*B + a*C))*Cot[e + f*x]*((a + b*Csc[e + f*x])^m/(a*f*(2*m + 1))), x]
+ Dist[1/(a*b*(2*m + 1)), Int[(a + b*Csc[e + f*x])^(m + 1)*Simp[A*b*(2*m + 1) + (b*B*(m + 1) - a*(A*(m + 1) -
C*m))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && EqQ[a^2 - b^2, 0] && LtQ[m, -2^(-1)]

Rubi steps \begin{align*} \text {integral}& = \frac {(B-C) \tan (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {\int \frac {a (B+2 C) \sec (c+d x)}{a+a \sec (c+d x)} \, dx}{3 a^2} \\ & = \frac {(B-C) \tan (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {(B+2 C) \int \frac {\sec (c+d x)}{a+a \sec (c+d x)} \, dx}{3 a} \\ & = \frac {(B-C) \tan (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {(B+2 C) \tan (c+d x)}{3 d \left (a^2+a^2 \sec (c+d x)\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.69 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {(B+2 C+(2 B+C) \cos (c+d x)) \sin (c+d x)}{3 a^2 d (1+\cos (c+d x))^2} \]

[In]

Integrate[(B*Sec[c + d*x] + C*Sec[c + d*x]^2)/(a + a*Sec[c + d*x])^2,x]

[Out]

((B + 2*C + (2*B + C)*Cos[c + d*x])*Sin[c + d*x])/(3*a^2*d*(1 + Cos[c + d*x])^2)

Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.68

method result size
parallelrisch \(-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (-3 B -3 C +\left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{6 a^{2} d}\) \(42\)
derivativedivides \(\frac {-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} B}{3}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} C}{3}+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C}{2 d \,a^{2}}\) \(60\)
default \(\frac {-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} B}{3}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} C}{3}+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C}{2 d \,a^{2}}\) \(60\)
risch \(\frac {2 i \left (3 B \,{\mathrm e}^{2 i \left (d x +c \right )}+3 B \,{\mathrm e}^{i \left (d x +c \right )}+3 C \,{\mathrm e}^{i \left (d x +c \right )}+2 B +C \right )}{3 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{3}}\) \(64\)
norman \(\frac {-\frac {\left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{6 a d}-\frac {\left (B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}+\frac {\left (2 B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 a d}}{a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )}\) \(89\)

[In]

int((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

-1/6*tan(1/2*d*x+1/2*c)*(-3*B-3*C+(B-C)*tan(1/2*d*x+1/2*c)^2)/a^2/d

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.94 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {{\left ({\left (2 \, B + C\right )} \cos \left (d x + c\right ) + B + 2 \, C\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}} \]

[In]

integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c))^2,x, algorithm="fricas")

[Out]

1/3*((2*B + C)*cos(d*x + c) + B + 2*C)*sin(d*x + c)/(a^2*d*cos(d*x + c)^2 + 2*a^2*d*cos(d*x + c) + a^2*d)

Sympy [F]

\[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {\int \frac {B \sec {\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \sec ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \]

[In]

integrate((B*sec(d*x+c)+C*sec(d*x+c)**2)/(a+a*sec(d*x+c))**2,x)

[Out]

(Integral(B*sec(c + d*x)/(sec(c + d*x)**2 + 2*sec(c + d*x) + 1), x) + Integral(C*sec(c + d*x)**2/(sec(c + d*x)
**2 + 2*sec(c + d*x) + 1), x))/a**2

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.50 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {\frac {C {\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{2}} + \frac {B {\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{2}}}{6 \, d} \]

[In]

integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c))^2,x, algorithm="maxima")

[Out]

1/6*(C*(3*sin(d*x + c)/(cos(d*x + c) + 1) + sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/a^2 + B*(3*sin(d*x + c)/(cos(
d*x + c) + 1) - sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/a^2)/d

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.97 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{6 \, a^{2} d} \]

[In]

integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c))^2,x, algorithm="giac")

[Out]

-1/6*(B*tan(1/2*d*x + 1/2*c)^3 - C*tan(1/2*d*x + 1/2*c)^3 - 3*B*tan(1/2*d*x + 1/2*c) - 3*C*tan(1/2*d*x + 1/2*c
))/(a^2*d)

Mupad [B] (verification not implemented)

Time = 15.58 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.73 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B+C\right )}{2\,a^2\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (B-C\right )}{6\,a^2\,d} \]

[In]

int((B/cos(c + d*x) + C/cos(c + d*x)^2)/(a + a/cos(c + d*x))^2,x)

[Out]

(tan(c/2 + (d*x)/2)*(B + C))/(2*a^2*d) - (tan(c/2 + (d*x)/2)^3*(B - C))/(6*a^2*d)